﻿<link href="@Url.Content("~/Content/zTreeStyle3.4/zTreeStyle.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.ztree.all-3.4.min.js")" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
    function loadUserActions() {
        var _setting = {
            data: {
                simpleData: { enable: true, idKey: "ActionID" },
                key: { name: "ActionName", title: "ActionName" }
            },
            check: {
                enable: true,
                chkStyle: 'checkbox'
            },
            async: { enable: true, url: getAsyncUrl },
            callback: { onCheck: zTreeUserActionCheck }
        };
        $.fn.zTree.init($("#UserActionTree"), _setting);
    }

    function getAsyncUrl(treeId, treeNode) {
        return '@Url.Content("~/SystemManage/User/GetUserActionTreeNodes/?userId=")' + '@ViewBag.UserID' +
        '&menuId=' + $("#MenuID").val();
    }
    function getUserActionTreeObj() {
        return $.fn.zTree.getZTreeObj("UserActionTree");
    }
</script>
<div class="zTreeBackground">
    <ul id="UserActionTree" class="ztree">
    </ul>
</div>